<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8">
	<title>今日工作</title>

	<!-- <link rel="stylesheet" href="../../bootstrap-3.3.5-dist/css/bootstrap.min.css">

     <script src="../../js/jquery-2.1.0.min.js"></script>
     <script src="../../bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>-->

	<link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

	<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
	<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>

	<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
	<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>

</head>
<body>

<div class="container" >
	<table class="table table-striped">

		<thead>

		<tr>
			<th>编号</th>
			<th>姓名</th>
			<th>状态</th>
		</tr>

		</thead>

		<tbody>

		<tr th:each="item:${patientis}">
				<td id="id" th:text="${item.getId()}"></td>
				<td id="name" th:text="${item.getName()}"></td>
				<td id="work" th:text="${item.getOrderdata()}"></td>

			<form action="/checkl" method="post" >
				<td>
					<input type="text" name="id" class="hidden"/>
					<button type="submit" class="btn btn-primary"  onclick="find(this)"> 查询</button>
				</td>
			</form>

			<form action="/deletel" method="post">
				<td>
					<input type="text" name="id" class="hidden"/>
					<button type="submit" class="btn btn-danger" onclick="find(this)"> 删除</button>
				</td>
			</form>

			<form action="">

			</form>
		</tr>

		</tbody>
	</table>
	<p  style="text-align: center;margin-top: 25%; " th:if="${#lists.size(patientis)<=0}" th:text="'今日暂无工作!'"></p>
</div>
</body>


<script>
    //实现将当前行id值放入form中
    function find(obj) {

        var id=$(obj).parent().siblings('#id').text();

        $(obj).prev().val(id);
    }

</script>
</html>